/* Message组件样式 */
.message {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  min-width: 300px;
  max-width: 400px;
  padding: 12px 16px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease-out;
  font-size: 0.9rem;
  line-height: 1.4;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.messageContent {
  display: flex;
  align-items: center;
  gap: 8px;
}

.messageIcon {
  font-size: 1.1rem;
  font-weight: bold;
  flex-shrink: 0;
}

.messageText {
  flex: 1;
  word-wrap: break-word;
}

.closeButton {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.closeButton:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

/* 成功消息 */
.message.success {
  background-color: var(--ifm-color-success-contrast-background);
  color: var(--ifm-color-success-contrast-foreground);
  border-left: 4px solid var(--ifm-color-success);
}

.message.success .messageIcon {
  color: var(--ifm-color-success);
}

/* 错误消息 */
.message.error {
  background-color: var(--ifm-color-danger-contrast-background);
  color: var(--ifm-color-danger-contrast-foreground);
  border-left: 4px solid var(--ifm-color-danger);
}

.message.error .messageIcon {
  color: var(--ifm-color-danger);
}

/* 警告消息 */
.message.warning {
  background-color: var(--ifm-color-warning-contrast-background);
  color: var(--ifm-color-warning-contrast-foreground);
  border-left: 4px solid var(--ifm-color-warning);
}

.message.warning .messageIcon {
  color: var(--ifm-color-warning);
}

/* 信息消息 */
.message.info {
  background-color: var(--ifm-color-info-contrast-background);
  color: var(--ifm-color-info-contrast-foreground);
  border-left: 4px solid var(--ifm-color-info);
}

.message.info .messageIcon {
  color: var(--ifm-color-info);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .message {
    top: 10px;
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: none;
  }
}

/* 暗色主题适配 */
html[data-theme='dark'] .message {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html[data-theme='dark'] .closeButton:hover {
  background-color: rgba(255, 255, 255, 0.1);
}